﻿@model IEnumerable<RssMVC4.ServiceReference.Flux> 
@{
    ViewBag.Title = "Home Page";
}
@section featured {
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1>Rss Reader</h1>
                <h2>@ViewBag.Message</h2>
            </hgroup>
          
        </div>
    </section>
}

<p>
    @Html.ActionLink("Create New", "CreatRss")
</p>
@if (Model != null)
{
<table>
    <tr>
        <th>
            Title
        </th>
        <th>
            Show
        </th>
        <th>
            Delete
        </th>
        <th>
            Edit
        </th>
    </tr>
@foreach (var post in Model)
{
    if (post.isRead == false)
    {
    <tr>
        <td>
         <a href="@post.Link" target="_blank"><b>@post.Title</b></a>
        </td>
       
         <td>
            <b>
         @Html.ActionLink("Show Rss", "ShowRss", new { id = post.ID, Link = post.Link, Title = post.Title })
            </b>
        </td>
         <td>
         <b>
         @Html.ActionLink("Delete", "DeleteRss", new { id = post.ID })
        </b>
      
        </td>
        <td>
           <b>
         @Html.ActionLink("Editt", "EditRss", new { id = post.ID, title = post.Title, link = post.Link })
        </b>
        </td>
    </tr>
    }
    else
    {
         <tr>
        <td>
         <a href="@post.Link" target="_blank">@post.Title</a>
        </td>
       
         <td>
         @Html.ActionLink("Show Rss", "ShowRss", new { id = post.ID, Link = post.Link, Title = post.Title })
        </td>
         <td>
         @Html.ActionLink("Delete", "DeleteRss", new { id = post.ID })
        </td>
         <td>
         @Html.ActionLink("Editt", "EditRss", new { id = post.ID, title = post.Title, link = post.Link })
         </td>
    </tr>
    }
}
</table>
}